package com.yowasa.xiuxian.constant;

import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.text.MessageFormat;

@Component
@ConfigurationProperties("mys")
@Setter
public class MysConfig {
    private String id;
    private String token;
    private boolean useSandBox;
    private String api;
    private String sandbox;

    public String getIdentityToken() {
        return MessageFormat.format("Bot {0}.{1}", id, token);
    }



    public String getUrl(String path, Object ... arguments) {
        String pattern = api + path;
        return MessageFormat.format(pattern,arguments);
    }
    
}
